@model FunnelWeb.Web.Areas.Admin.Views.Admin.CommentsModel
@{
  ViewBag.Title = "FunnelWeb Administration - Comments";
  Layout = "~/Areas/Admin/Views/Shared/_Private.cshtml";
}

<h1>Comments</h1>	    
<p>
  FunnelWeb comments are automatically sent to <strong><a href="http://akismet.com">Akismet</a></strong> for spam filtering.
  You can also add your own blacklist of naughty words considered as spam on the @Html.AdminActionLink("general settings", "Settings", "Admin") page.
</p>
          
<p>
  @Html.AdminActionLink("Delete all Spam", "DeleteAllSpam", "Admin")
</p>

@foreach (var comment in Model.Comments) {
<div class='comment-admin'>
  <table width="90%" class='comment @(comment.IsSpam ? "spam" : "")'>
    <tr>
      <td colspan="2" width="90%">
        <strong><a href="/@comment.Entry.Name/#comment-@comment.Id">@comment.Entry.Title</a></strong><br />
        @Html.DisplayFor(_ => comment.Body, new { Sanitize = true })
      </td>
    </tr>
    <tr>
      <td width="75%">
        <strong>Author: </strong> @comment.AuthorName <br />
        <strong>URL: </strong> @comment.AuthorUrl <br />
        <strong>Email: </strong> @comment.AuthorEmail
      </td>
      <td width="25%">
        @Html.ActionLink("Delete", "DeleteComment", "Admin", new { Area = "Admin", id = comment.Id }, null)
        @Html.ActionLink(comment.IsSpam ? "Unspam" : "Spam", "ToggleSpam", "Admin", new { Area = "Admin", id = comment.Id }, null)
      </td>
    </tr>
  </table>
</div>
}

@Paginator.Render("Comments", Model.PageNumber, Model.TotalPages)
